Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the module using the PDK #344

Closed
wants to merge 22 commits into from
Closed

Update the module using the PDK #344

wants to merge 22 commits into from

Conversation

smortex
Copy link
Collaborator

@smortex smortex commented Feb 9, 2022

Update with a recent PDK with the latest templates.

Allows up to have working CI.

@puppet-community-rangefinder
Copy link

puppetdb::database::postgresql is a class

that may have no external impact to Forge modules.

This module is declared in 33 of 579 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

@CLAassistant
Copy link

CLAassistant commented Apr 19, 2023

CLA assistant check
All committers have signed the CLA.

Sync from the puppetlabs-apt module for settings related to GitHub
actions support and other CI "deprecation".
We are interested in the list of all installed modules, we do not care
about messages on stderr like:
```
bash: warning: setlocale: LC_ALL: cannot change locale (fr_FR.UTF-8)
```
We need the contrib packages only with older versions of PostgreSQL.
While here include this class when it is needed instead of using
a resource to avoid conflicts when another module wants to do this.
PostgreSQL is configured to use snakeoil certificates, but PuppetDB
expect to use the Puppet certificates to authenticate with needs more
code that we currently have in the tests.
the provision module was not found in /home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/spec/fixtures/modules, please amend the .fixtures.yml file
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/puppet_litmus-0.34.3/lib/puppet_litmus/rake_helper.rb:121:in `provision'
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/puppet_litmus-0.34.3/lib/puppet_litmus/rake_tasks.rb:81:in `block (2 levels) in <top (required)>'
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/honeycomb-beeline-2.11.0/lib/honeycomb/integrations/rake.rb:21:in `block in execute'
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/honeycomb-beeline-2.11.0/lib/honeycomb/client.rb:65:in `start_span'
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/honeycomb-beeline-2.11.0/lib/honeycomb/integrations/rake.rb:16:in `execute'
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/opt/hostedtoolcache/Ruby/2.7.6/x64/bin/bundle:23:in `load'
/opt/hostedtoolcache/Ruby/2.7.6/x64/bin/bundle:23:in `<main>'
puppet_agent was not found in /home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/spec/fixtures/modules, please amend the .fixtures.yml file
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/puppet_litmus-0.34.3/lib/puppet_litmus/rake_helper.rb:221:in `block in install_agent'
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/honeycomb-beeline-2.11.0/lib/honeycomb/client.rb:65:in `start_span'
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/forwardable-1.3.2/lib/forwardable.rb:238:in `start_span'
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/puppet_litmus-0.34.3/lib/puppet_litmus/rake_helper.rb:210:in `install_agent'
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/puppet_litmus-0.34.3/lib/puppet_litmus/rake_tasks.rb:126:in `block (2 levels) in <top (required)>'
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/honeycomb-beeline-2.11.0/lib/honeycomb/integrations/rake.rb:21:in `block in execute'
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/honeycomb-beeline-2.11.0/lib/honeycomb/client.rb:65:in `start_span'
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/honeycomb-beeline-2.11.0/lib/honeycomb/integrations/rake.rb:16:in `execute'
/home/runner/work/puppetlabs-puppetdb/puppetlabs-puppetdb/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/opt/hostedtoolcache/Ruby/2.7.6/x64/bin/bundle:23:in `load'
/opt/hostedtoolcache/Ruby/2.7.6/x64/bin/bundle:23:in `<main>'
Bolt::PAL::PALError: Could not find module facts containing task file bash.sh
For now we want to have running CI.  We do not care about the module
being fully documented.
They break adding facts from a context.
@@ -184,7 +187,7 @@
it 'has read ident rule' do
is_expected.to contain_postgresql__server__pg_ident_rule("Map the SSL certificate of the server as a #{params[:read_database_username]} user")
.with_map_name(read_identity_map)
.with_system_username(facts[:fqdn])
.with_system_username(facts[:networking][:fqdn])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't that be:

Suggested change
.with_system_username(facts[:networking][:fqdn])
.with_system_username(facts[:networking]['fqdn'])

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Humm… it seems to be worse. That being said at the beginning of the file we have:

      let(:facts) do
        {
          # ...
          networking: {
            fqdn: 'cheery-rime@puppet',
          },
          # ...
        }
      end

This module is hell… 😱

@smortex
Copy link
Collaborator Author

smortex commented Oct 9, 2023

Current state: out of the failing unit tests, some are due to the module saying it support Ubuntu 16.04 which is EOL and for which the postgresql module drop support more than 1 year ago. I'll try to fix the other unit tests, when done will in another PR to drop EOL OS.

This was changed in 68d8c64 to fix
puppet lint issues, but as the test suite was not run it passed through.
This was changed in 010bf13 to match
best practice, but as the test suite was not run it passed through.
The systemd module use this to run `systemctl daemon-reload`.  Set an
arbitrary value to avoid:

> Validation of Exec[systemd-postgresql.service-systemctl-daemon-reload] failed: 'systemctl' is not qualified and no path was specified. Please qualify the command or specify a path.
@smortex
Copy link
Collaborator Author

smortex commented Oct 9, 2023

LGTM regarding unit tests.

I will drop Ubuntu 16.04 which has been EOL for 2.5 years in another PR and the unit tests should be green.

Because the module has been lagging behind for years, I'll wait for this to be merged before investing more time in fixing the tests.

@smortex smortex mentioned this pull request Oct 9, 2023
This was referenced Jan 27, 2024
@h0tw1r3
Copy link
Contributor

h0tw1r3 commented Feb 2, 2024

all changes were cherry-picked into #385

@h0tw1r3 h0tw1r3 closed this Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants